<template>
	<view class="app">
		<view class="order">
			<view class="item" v-for="(item, index) in goodsList" :key="index">
				<view class="content">
					<view class="title u-line-2">{{ item.title }}</view>
					<view class="type">{{item.cont}}</view>
					<view class=".delivery-time">{{ item.type }} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ item.deliveryTime }}参与</view>

				</view>
				<view class="left">
					<image :src="item.goodsUrl" mode="aspectFill"></image>
				</view>
			</view>
		</view>
		<view style="background-color: #ffffff;" class="xieyi"><span class="span1">我已同意</span><span class="span2">收费讲堂服务协议</span>
			<u-switch v-model="checked" class="switc"></u-switch>
		</view>
		<view class="dibu">
			<view class="dibu1">合计：￥1.00</view>
			<view class="dibu2">提交订单</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				checked: false,
				goodsList: [{
					goodsUrl: '//img14.360buyimg.com/n7/jfs/t1/60319/15/6105/406802/5d43f68aE9f00db8c/0affb7ac46c345e2.jpg',
					title: '口腔溃疡总反复？口腔科医生来帮你',
					type: '￥1.00',
					cont: '何亮剑，浙江大学医学附属第二医院...',
					deliveryTime: '1179'
				}]
			}
		},
		methods: {
			// switch打开或者关闭时触发，值为true或者false
			// 即使不监听此事件，this.checked此时也会相应的变成true或者false
			change(status) {
				// console.log(status);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.dibu {
		display: flex;
		justify-content: center;
		align-items: center;
		position: fixed;
		bottom: 0px;
		width: 100%;

	}

	.dibu1 {
		padding: 10px;
		height: 36px;
		text-align: center;
		background-color: #FFFFFF;
		flex: 4;

	}

	.dibu2 {
		padding: 10px;
		color: #FFFFFF;
		height: 36px;
		text-align: center;
		background-color: #00baad;
		flex: 5;
	}

	.xieyi {
		height: 40px;
		display: flex;
		justify-content: left;
		align-items: center;
	}

	.span1 {
		flex: 1;
		margin-left: 20px;
	}

	.span2 {
		flex: 2;
		margin-left: 20px;
		color: #00baad;
	}

	.app {
		background-color: #faf8f8;
		height: 800px;
	}

	.switc {
		margin-right: 40px;
	}

	.order {
		background-color: #ffffff;
		margin: 0 0;

		box-sizing: border-box;
		padding: 20rpx;
		font-size: 28rpx;
		border-top: 3px #f2f1f1 solid;
		border-bottom: 3px #f2f1f1 solid;

		.item {
			display: flex;
			margin: 20rpx 12rpx 0;

			.left {
				margin-left: 55rpx;

				image {
					width: 180rpx;
					height: 180rpx;
					border-radius: 10rpx;
				}
			}

			.content {
				margin-left: 2rpx;

				.title {
					font-size: 28rpx;
					line-height: 50rpx;
				}

				.type {
					margin: 30rpx 0;
					font-size: 24rpx;
					color: #505050;
				}

				.delivery-time {
					margin: 5rpx 0;
					color: #505050;
					font-size: 24rpx;
					display: flex;
					justify-content: center;
				}
			}

		}
	}
</style>
